<!DOCTYPE html>
<html style="height: 100%;">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit"/><!-- 让360浏览器默认选择webkit内核 -->

    <!-- 全局css -->
    <link rel="shortcut icon" href="${ctxPath}/static/favicon.ico">
    <link href="${ctxPath}/static/libs/bootstrap/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	
	<!-- <link href="/css/non-responsive.css" rel="stylesheet" media="screen"> -->
    <link href="${ctxPath}/static/libs/font-awesome/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="${ctxPath}/static/libs/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="${ctxPath}/static/libs/hisui/css/hisui.css" rel="stylesheet">
    <link href="${ctxPath}/static/backend/common.css" rel="stylesheet">
    <link href="${ctxPath}/static/libs/layer/theme/hisui/style.css/" rel="stylesheet">
<!--    <link href="${ctxPath}/static/libs/layui/css/layui.css" rel="stylesheet">-->
    <link href="${ctxPath}/static/libs/layer/hisui/style.css" rel="stylesheet">

    <!-- 全局js -->
    <!-- <script src="${ctxPath}/static/libs/jquery/jquery.min.js?v=2.1.4"></script> -->
    <script src="${ctxPath}/static/libs/jquery/jquery-1.9.1.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap/bootstrap.min.js?v=3.3.6"></script>
    <script src="${ctxPath}/static/libs/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap-table/bootstrap-table-fixed-columns.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<!--    <script src="${ctxPath}/static/libs/bootstrap-table/xlsx.core.min.js"></script>-->
<!--    <script src="${ctxPath}/static/libs/bootstrap-table/bootstrap-table-export.js"></script>-->
	<script src="${ctxPath}/static/libs/bootstrap-table/tableExport.js"></script>
	<script src="${ctxPath}/static/libs/bootstrap-table/jquery.base64.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap-table/bootstrap-table-resizable.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap-table/colResizable-1.6.js"></script>
    <script src="${ctxPath}/static/libs/bootstrap-treetable/bootstrap-treetable.js"></script>
    <script src="${ctxPath}/static/libs/layer/layer.js"></script>
    <script src="${ctxPath}/static/libs/laydate/laydate.js"></script>
    <script src="${ctxPath}/static/libs/hisui/js/jquery.hisui.js"></script>
	<script src="${ctxPath}/static/libs/hisui/js/locale/hisui-lang-zh_CN.js"></script>
	<script src="${ctxPath}/static/libs/echarts/echarts.min.js"></script>
    <script src="${ctxPath}/static/common/js/ajax-object.js"></script>
    <script src="${ctxPath}/static/common/js/bootstrap-table-object.js"></script>
    <script src="${ctxPath}/static/common/js/vtecommon.js"></script>
    <!--script src="${ctxPath}/static/common/js/SysForHis.js"></script-->

</head>

<body>
    ${layoutContent}
<script type="text/javascript">
// Image Manager
$(document).on('click', 'a[data-toggle=\'image\']', function(e) {
    var $element = $(this);
    var $popover = $element.data('bs.popover'); // element has bs popover?
    
    e.preventDefault();

    // destroy all image popovers
    $('a[data-toggle="image"]').popover('destroy');

    // remove flickering (do not re-add popover when clicking for removal)
    if ($popover) {
        return;
    }

    $element.popover({
        html: true,
        placement: 'right',
        trigger: 'manual',
        content: function() {
            return '<button type="button" id="button-image" class="btn btn-primary"><i class="fa fa-pencil"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="fa fa-trash-o"></i></button>';
        }
    });

    $element.popover('show');

    $('#button-image').on('click', function() {
        var $button = $(this);
        var $icon   = $button.find('> i');
        
        $('#modal-image').remove();
        
        imagemanager_last_open_folder = '';
        
        $.ajax({
            url: '${ctxPath}/imagemanager?target=' + $element.parent().find('input').attr('id') + '&thumb=' + $element.attr('id'),
            dataType: 'html',
            beforeSend: function() {
                $button.prop('disabled', true);
                if ($icon.length) {
                    $icon.attr('class', 'fa fa-circle-o-notch fa-spin');
                }
            },
            complete: function() {
                $button.prop('disabled', false);
                if ($icon.length) {
                    $icon.attr('class', 'fa fa-pencil');
                }
            },
            success: function(html) {
                $('body').append('<div id="modal-image" class="modal">' + html + '</div>');

                $('#modal-image').modal('show');
            }
        });

        $element.popover('destroy');
    });

    $('#button-clear').on('click', function() {
        $element.find('img').attr('src', $element.find('img').attr('data-placeholder'));

        $element.parent().find('input').val('');

        $element.popover('destroy');
    });
});
</script>

</body>
</html>
